﻿using System; 

static class CSTimesExtentions 
{
  public void CsTimes(this int n, Action action)
  {
    for (var i = 0; i < n; i++) action();
  }
}

class CSTimes
{
  public CSTimes() {}  
  
  public void UseTimes()
  {
    5.CsTimes(() => Console.WriteLine("Foo!"));
  }
}